package com.BlogPark.pojo;

import com.BlogPark.mapper.CollectionsMapper;
import com.BlogPark.mapper.CommentsMapper;
import com.BlogPark.mapper.LikesMapper;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Date;

/**
 * @Auther: MFM
 * @Date: 2022/8/10 - 08 - 10 - 18:05
 * @version: 1.0
 */
@Data
@Repository
public class Article {
    @Autowired
    private LikesMapper likesMapper;
    @Autowired
    private CommentsMapper commentsMapper;
    @Autowired
    private CollectionsMapper collectionsMapper;

    private String id;
    private String title;
    private Date date;
    private String labels;
    private String content;
    private boolean privacy;

    private int views;
    private int collection;
    private int likes;
    private int comments;
    private int autherId;
    private String autherName;
    private String introduce;

    public Article() {
    }

    /**
     * 文章信息
     *
     * @param id         文章id
     * @param title      文章标题
     * @param date       文章发布日期
     * @param labels     标签
     * @param content    内容
     * @param privacy    隐私（是否公开）
     * @param views      浏览量
     * @param collection 收藏量
     * @param likes      点赞数
     * @param comments   评论数
     * @param autherId   作者id
     *        introduce  文章简介
     */
    public Article(String id, String title, Date date, String labels, String content, boolean privacy, int views, int collection, int likes, int comments, int autherId,String autherName,String introduce) {
        this.id = id;
        this.title = title;
        this.date = date;
        this.labels = labels;
        this.content = content;
        this.privacy = privacy;
        this.views = views;
        this.collection = collection;
        this.comments =comments;
        this.likes = likes;
        this.autherId = autherId;
        this.autherName = autherName;
        this.introduce = introduce;
    }

}
